/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sudoku;

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import Modelo.TableroInicial6x6;


/**
 *
 * @author sabrina
 */
public class IniciarNivel6x6V1 implements IController {
    
    private TableroSudoku6x6V1 tab;   
    public static int [][] matriz = new int[6][6];  
    private NivelYTamanio nyt;
    TableroController x;
    static Cronometro c;
    TableroInicial6x6 tabI;
    
    public void process(String model){  
     //CRONOMETRO QUE CONTROLA LA PARTIDA
   c=new Cronometro();
   c.setLocation(900, 600); 
   c.iniciarCronometro();      
        
    if (x.nivel.equals("Nivel 1")){
        tabI=new TableroInicial6x6(matriz);
        matriz=tabI.generarTablero(15);
                  
    }else if(x.nivel.equals("Nivel 2")){

        tabI=new TableroInicial6x6(matriz);
        matriz=tabI.generarTablero(10);
                
    }else if(x.nivel.equals("Nivel 3")){
        
        tabI=new TableroInicial6x6(matriz);
        matriz=tabI.generarTablero(6);
        
    }
    
      int p=0;
       for (int x=0; x < matriz.length; x++) {
                for (int y=0; y < matriz[x].length; y++) {
                     int z= matriz[x][y];
                    if (z!=0){                      
                     tab.text1[p].setEditable(false);
                     tab.text1[p].setText(String.valueOf(matriz[x][y]));                
                    }
                    else{
                        tab.text1[p].setText("");
                        tab.text1[p].setEditable(true);
                    }
                    p++;
    }
                
  }
}
    
    
    
   

     
    public void setView(IView x) {
       this.tab = (TableroSudoku6x6V1) x;             
}
}